<?php $this->_Hhead()?>
<link href="/Public/Home/public/common.css" rel="stylesheet" type="text/css">
<link href="/Public/Home/public/all_common.css" rel="stylesheet" type="text/css">


<script type="text/javascript" src="/Public/Home/public/jquery.SuperSlide.2.1.1.js "></script>
<!--<script type="text/javascript" src="/Public/Home/public/checkout.js "></script>-->
<script type="text/javascript" src="/Public/Home/public/utils.js "></script>
<script type="text/javascript" src="/Public/Home/public/jquery-ui.js "></script>
<!--页面js-->
<script type="text/javascript" src="/Public/Home/public/region.js "></script>
<script type="text/javascript" src="/Public/Home/public/address.js "></script>
<div id="dialog-modal" title="收货地址" style="display: none;"></div>
<div class="container clearfix">
    <div class="navbar step-two">
        <span>1 我的购物车</span>
        <span class="on">2 填写核对订单信息</span>
        <span>3 成功提交订单</span>
    </div>
    <div class="checkout-box">
        <form action="/index.php?C=Order&F=OrderAdd" method="post" name="theForm" id="theForm">
            <div class="checkout-box-bd">

                <div class="xlj-box">
                    <div class="box-hd ">
                        <h2 class="title">收货地址</h2>
                    </div>
                    <div class="box-bd">
                        <div class="clearfix xlj-address-list" id="checkoutAddrList">
                            <?php foreach($paths as $v){?>
                                <dl class="item " pid="<?php echo $v['id']?>">
                                    <dt>
                                        <strong class="consignee"><?php echo $v['name']?></strong>
                                    </dt>
                                    <dd>
                                        <p class="telphone"><?php echo $v['phone']?></p>
                                        <p class="address"><?php echo $v['sheng'].$v['shi'].$v['qu']?></p>
                                        <p class="zipcode"><?php echo $v['txt']?></p>
                                        <p><a title="编辑" href="javascript:void(0)"><span class="address-edit" data-addressid="112905" data-type="checkout"></span></a>&nbsp;&nbsp;<a title="删除" href="javascirpt:void(0)"><span class="address-del" data-addressid="112905" data-type="checkout"></span></a> </p>
                                    </dd>
                                </dl>
                            <?php }?>

                            <div class="item use-new-addr" id="AddNewAddress" data-type="checkout">
                                <span class="icon-add"></span>添加新地址
                            </div>
                        </div>
                    </div>
                </div>

                <div id="checkoutPayment">

                    <div class="xlj-box">
                        <div class="box-hd ">
                            <h2 class="title">支付方式</h2>
                        </div>
                        <div class="box-bd-chekout">
                            <p></p>
                            <select style="height: 26px;
    margin-bottom: 20px;" name="pay" id="">
                                <option value="余额支付">余额支付</option>
                                <option value="支付宝">支付宝</option>
                            </select>
                        </div>
                    </div>

                </div>

            </div>
            <div class="checkout-box-ft clearfix">

                <div id="checkoutGoodsList" class="checkout-goods-box">
                    <div class="xlj-box">
                        <div class="box-hd">
                            <h2 class="title">商品信息</h2>
                        </div>
                        <div class="box-bd-chekout">
                            <table class="checkout-goods-list" cellpadding="0" cellspacing="0">
                                <thead>
                                <tr>
                                    <th class="col-1">商品名称</th>
                                    <th class="col-2">价格</th>
                                    <th class="col-2">购买数量</th>
                                    <th class="col-2">小计</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php
                                    $znum=0;
                                    $zmoney=0;
                                foreach($arr as $v){
                                    $znum+=$v['num'];
                                    $zmoney+=($v['money']+$v['gmoney'])*$v['num'];
                                ?>
                                 <tr>
                                    <td class="col-1">
                                        <a href="<?php echo '/index.php?C=Index&F=goods_msg&id='.$v['g_id']?>" target="_blank">
                                        <?php echo $v['name']?> | 规格:<?php echo $v['gname']?>
                                        </a>
                                    </td>
                                    <td class="col-2">￥<?php echo $v['money']+$v['gmoney']?>元</td>
                                    <td class="col-2"><?php echo $v['num']?></td>
                                    <td class="col-2">￥<?php echo ($v['money']+$v['gmoney'])*$v['num']?>元</td>
                                </tr>
                                <?php }?>
                                </tbody>
                            </table>
                            <div class="checkout-count clearfix">
                                <div class="checkout-price" id="checkout-price">
                                    <ul>
                                        <li>
                                            <?php echo $znum;?>件
                                        </li>
                                        <li>
                                            金额合计：￥ <?php echo $zmoney;?>元
                                        </li>
                                        <li>
                                            总计：<strong id="totalPrice">￥ <?php echo $zmoney;?>元</strong>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="check-address clearfix" id="chechout_address_bottom">
                            <p id="ti"></p>
                        </div>
                    </div>
                </div>

            </div>
            <div class="go-next clearfix">
                <a class="btn btn-back " href="/index.php?C=Order&F=flow"> 返回购物车 </a>&nbsp;&nbsp;
                <a class="btn btn-primary" href="javascript:void(0)" id="orderNow" data-val="0">立即下单</a>
            </div>
            <input type="hidden" name="id" value="<?php echo $_GET['id']?>">
            <input type="hidden" id="p_id" name="p_id">
        </form>
    </div>
</div>
<script>
    $(function(){
        $('#orderNow'). bind('click',function(){
            //获取地址，提交表单
           var pid=$('.checked-on').attr('pid');
            if(!pid){
                alert('请选择收货地址！');
                return false;
            }
            $('#p_id').val(pid);

            //提交表
            $('#theForm').submit();
        })
    })

    $('.item').bind('click',function(){
        $('#ti').html($(this).find('.consignee').html()+$(this).find('.address').html()+$(this).find('.zipcode').html()+$(this).find('.telphone').html());
    })
    var $k='Order';
    var $k1='';
</script>
<?php $this->_Hfooter()?>